'use strict';
module.exports = app => {
  const Sequelize = app.Sequelize;
  const ctx = app.createAnonymousContext();
  const { models } = app.model;

  const user_role = app.model.define(
    'user_roles',
    {
      id: { type: Sequelize.INTEGER, primaryKey: true, autoIncrement: true },
      user_id: Sequelize.INTEGER(11),
      role_id: Sequelize.INTEGER(11),
    },
    {}
  );
  user_role.associate = function(models) {
    // associations can be defined here
    app.model.UserRoles.belongsTo(app.model.Roles, {
      foreignKey: 'role_id',
      targetKey: 'id',
    });
  };
  return user_role;
};
